package com.zkny.zknyerp.utils;

import org.apache.shiro.crypto.hash.Md5Hash;
import org.junit.Test;

/*获取MD5加密密码工具类*/
public class MD5Utils {

    /**
     *获取MD5加密后的密码，2次MD5加密，用户名加盐
     * @param username
     * @param password
     * @return
     */
    public static String getMD5Pwd(String username, String password){
        Md5Hash md5Hash = new Md5Hash(password, username, 2);
        return md5Hash.toString();
    }

    @Test
    public void md5(){
        String s = "zhongkenuoya";
        Md5Hash md5Hash = new Md5Hash(s, s, 2);
        System.out.println(md5Hash);
    }
}
